<%@ page contentType="text/html;charset=utf-8"%>
<%@page import="com.cs.beneficios.common.ConnectionFactory,com.cs.beneficios.common.entity.Consultas,java.sql.Connection,java.sql.ResultSet,java.sql.SQLException"%>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Detalle Subprograma</title>
    <script language="javascript">
       
       function fModificar(){
        document.form.submit();
        }
        
         function fNuevo(){
         location.href = "IngresarSubprograma.jsp";
        }
    </script>
  </head>
  <body>
   <link href="<%= request.getContextPath() + "/css/bloques.css" %>" rel="stylesheet" type="text/css">
    <P>&nbsp;</P>
    <P>&nbsp;</P>
    <P>&nbsp;</P>
    <P align="center" class="titulosenblanco">ADMINISTRACI&Oacute;N DE SUBPROGRAMA</P>
    <P>&nbsp;</P>
    <form name="form" method="get" action="../../servlets/subprogramas/ingresarsubprograma">
    <table cellspacing="3" cellpadding="2" border="0" width="70" align="center">
<%
String strsubpgr = request.getParameter("Codigo");
String strnomsub = "";
String strpgr = "";
String strarea = "";
String strdescrip = "";
String strutil = "";
String strvalor = "";
String strvigencia = "";
String stradmon = "";
String strdesde = "";
String strhasta = "";
String strestudiantes = "";
String strsisben = "";
String strgrupo = "";


//ConnectionFactory cf = new ConnectionFactory("beneficios","beneficios");
ConnectionFactory cf = new ConnectionFactory();
Consultas consulta = new Consultas(cf);
ResultSet rs = null;

 rs = consulta.getDetSubpgr(strsubpgr);
 
    if (rs != null){
     try{
       while(rs.next()){
          strnomsub = rs.getString("subprograma");         
          strpgr = rs.getString("programa");
          strarea = rs.getString("secretaria");
          strdescrip = rs.getString("descripcion");
          strutil = rs.getString("utilizacion");
          strvalor = rs.getString("valor");
          strdesde = rs.getString("desde");
          strhasta = rs.getString("hasta");
          strgrupo = rs.getString("grupo");
          strestudiantes = rs.getString("estudiantes");
          strsisben = rs.getString("sisben");
          strvigencia = rs.getString("vigencia");
          stradmon = rs.getString("usuario");  
          }
        }catch(SQLException e){
            e.printStackTrace();
        }
          }else{%>
              <tr>
              <td colspan="2">
              <font>Ocurrio un error, al realizar la consulta</font> 
              </td>
              </tr>
              <DIV align="center">
                <% }%>
              </DIV>

      <tr>
        <td width="8%">
          <DIV align="center">&nbsp;</DIV>
        </td>
        <td width="12%"  class="celdatabla">Nombre</td>
        <td width="80%"><input type="text" class="form" name="subprograma"  value="<%=strnomsub%>" maxlength="40" size="40" readonly/></td>
      </tr>
      <tr>
        <td width="8%">&nbsp;</td>
        <td width="12%"  class="celdatabla">Programa</td>
        <td width="80%"><input type="text" class="form"  value="<%=strpgr%>" maxlength="40" size="40" readonly/></td>
      </tr>
      <tr>
        <td width="8%">&nbsp;</td>
        <td width="12%"  class="celdatabla">Secretaria</td>
        <td width="80%"><input type="text" class="form" value="<%=strarea%>" maxlength="40" size="40" readonly/></td>
      </tr>
      <tr>
        <td width="8%">&nbsp;</td>
        <td width="12%"  class="celdatabla">Descripcion</td>
        <td width="80%">
          <textarea name="descripcion" class="form" cols="40" rows="5" readonly disabled><%=strdescrip%></textarea>
        </td>
      </tr>
      <tr>
        <td width="8%">&nbsp;</td>
        <td width="12%"  class="celdatabla">Utilizaci&oacute;n</td>
        <td width="80%"><input type="text" class="form" name="diasutil" value="<%=strutil%>" maxlength="15" size="15" readonly/></td>
      </tr>
      <tr>
        <td width="8%">&nbsp;</td>
        <td width="12%"  class="celdatabla">Valor</td>
        <td width="80%"><input type="text" class="form" name="valor" value="<%=strvalor%>" maxlength="30" size="30" readonly/></td>
      </tr>
      <tr>
        <td width="8%">&nbsp;</td>
        <td width="12%"  class="celdatabla">Desde</td>
        <td width="80%"><input type="text" class="form" name="valor" value="<%=strdesde%>" maxlength="11" size="11" readonly/></td>
      </tr>
      <tr>
        <td width="8%">&nbsp;</td>
        <td width="12%"  class="celdatabla">Hasta</td>
        <td width="80%"><input type="text" class="form" name="valor" value="<%=strhasta%>" maxlength="11" size="11" readonly/></td>
      </tr>
      <tr>
        <td width="8%">&nbsp;</td>
        <td width="12%"  class="celdatabla">Aplica para el grupo familiar?</td>
        <td width="80%"><input type="text" class="form" name="valor" value="<%=strgrupo%>" maxlength="10" size="10" readonly/></td>
      </tr>
      <tr>
        <td width="8%">&nbsp;</td>
        <td width="12%"  class="celdatabla">Se valida con la BD de Estudiantes</td>
        <td width="80%"><input type="text" class="form" name="valor" value="<%=strestudiantes%>" maxlength="10" size="10" readonly/></td>
      </tr>
      <tr>
        <td width="8%">&nbsp;</td>
        <td width="12%"  class="celdatabla">Se valida con la BD de SISBEN?</td>
        <td width="80%"><input type="text" class="form" name="valor" value="<%=strsisben%>" maxlength="10" size="10" readonly/></td>
      </tr>
      <tr>
        <td width="8%">&nbsp;</td>
        <td width="12%"  class="celdatabla">Vigencia</td>
        <td width="80%"><input type="text" class="form" name="vigencia" value="<%=strvigencia%>" maxlength="10" size="10" readonly/></td>
      </tr>
      <tr>
        <td width="8%">&nbsp;</td>
        <td width="12%"  class="celdatabla">Administrador</td>
        <td width="80%"><input type="text" class="form" value="<%=stradmon%>" maxlength="30" size="30" readonly/></td>
      </tr>
      <tr>
        <td width="8%">&nbsp;</td>
        <td width="12%"  class="celdatabla">&nbsp;</td>
        <td width="80%"></td>
      </tr>  
         
      <tr>
        <td width="8%"></td>
        <td width="12%"  class="celdatabla">
          <P>
            &nbsp;&nbsp;
          </P>
        </td>
        <td width="80%">
          <input type="hidden" name="ori" value="mod"/>
          <input type="hidden" name="Subprograma" value="<%=strsubpgr%>"/>
        </td>
      </tr>
    </table>
    <P align="center">
      <a href="javascript:window.history.back()">
        <img src="<%=request.getContextPath() + "/images/BACK1-1.gif"%>" border="0"/>
      </a>
    </P>
    <P>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    </P>
    
    <% cf.closeConnection(consulta.getConn());%>
    </form>
    <P align="center">&nbsp;</P>
  </body>
</html>
